"""
example03 - 列表的遍历（把每个元素依次取出来）

索引运算（下标运算） - 通过正向或负向索引获取元素

Author: Administrator
Date: 2024/1/8
"""

nums = [35, 98, 12, 27, 66]

print(nums[0], nums[-5])
print(nums[2], nums[-3])
print(nums[5], nums[-1])

nums[2] = 120

print(nums)

for i, x in enumerate(nums):
    print(i, x)

for i in range(len(nums)):
    print(i, nums[i])

for num in nums:
    print(num)
